<template>
 <transition name="modal">
   <div class="modal-mask">
     <div class="modal-container">
       <div class="modal-header">
         <slot name="header">
           default header
         </slot>
       </div>
       <div class="modal-body">
         <slot name="body">
           default body
         </slot>
       </div>
       <div class="modal-footer">
         <slot name="fotter">
           <button class="modal-default-button" @click="$emit('close')">OK</button>
         </slot>
       </div>
     </div>
   </div>
 </transition>
</template>
<script>
export default {}
</script>
<style lang="scss" scoped>
.modal-mask {
  position: fixed;
  z-index: 9998;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease;
}
.modal-container {
  padding: 20px 30px;
  width: 300px;
  background-color: #fff;
  border-radius: 2px;
  transition: all .3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.33);
}
.modal-body {
  margin: 20px 0;
}
.modal-default-button {
  float: right;
}
.modal-enter,
.modal-leave-active {
  opacity: 0;
}
.modal-enter,
.modal-leave-active {
  .modal-container {
   transform: scale(1.1);
  }
}
</style>
